package com.nova.health.ble.device;

import android.annotation.SuppressLint;
import android.content.Context;

import java.util.UUID;


/**
 * 具体的硬件设备,如果有多台设备，可以有多个该类的定义。
 *
 * @author 002034
 */
public class MyBleDevice extends BaseBleDevice {
    private static final String TAG = "BleDevice";

    /**
     * 根据具体硬件进行设置
     **/
    public String MAC = "";
    //重新连接
    public boolean isConnect = true;

    public void setDevice_Service_UUID(UUID DEVICE_SERVICE_UUID) {
        this.DEVICE_SERVICE_UUID = DEVICE_SERVICE_UUID;
        serviceUuid = DEVICE_SERVICE_UUID;
    }

    public void setDevice_Notify_UUID(UUID DEVICE_NOTIFY_UUID) {
        this.DEVICE_NOTIFY_UUID = DEVICE_NOTIFY_UUID;
        notifyUuid = DEVICE_NOTIFY_UUID;
    }

    public void setDEVICE_write_UUID(UUID DEVICE_WRITE_UUID) {
        this.DEVICE_WRITE_UUID = DEVICE_WRITE_UUID;
        writeUuid = DEVICE_WRITE_UUID;
    }

    //脉搏波血压4.0特服务、征码
    public UUID DEVICE_SERVICE_UUID = UUID.fromString("0000fff0-0000-1000-8000-00805f9b34fb");
    public UUID DEVICE_NOTIFY_UUID = UUID.fromString("0000fff1-0000-1000-8000-00805f9b34fb");
    public UUID DEVICE_WRITE_UUID = UUID.fromString("0000fff2-0000-1000-8000-00805f9b34fb");

    public String getMAC() {
        return MAC;
    }

    public void setMAC(String MAC) {
        this.MAC = MAC;
    }

    public boolean isConnect() {
        return isConnect;
    }

    public void setConnect(boolean connect) {
        isConnect = connect;
    }

    @SuppressLint("StaticFieldLeak")
    private static MyBleDevice mBleDevice;

    private MyBleDevice(Context context) {
        super(context);
//        serviceUuid = DEVICE_SERVICE_UUID;
//        writeUuid = DEVICE_WRITE_UUID;
//        notifyUuid = DEVICE_NOTIFY_UUID;
    }

    public static MyBleDevice getInstance(Context context){
        if(mBleDevice == null){
            mBleDevice = new MyBleDevice(context);
        }
        return mBleDevice;
    }
}
